<div ui-view>
	<div class="p-workflow-list">
	  <bread-crumb link-data="vm.breadCrumbArr"></bread-crumb>
	  <div class="pt-2">
		  <div class="toolbar">
		    <div class="btn-group" uib-dropdown dropdown-append-to-body>
		      <button id="btn-append-to-body" type="button" class="btn btn-default-dark" uib-dropdown-toggle> 创建工作流 <span class="caret"></span>
		      </button>
		      <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="btn-append-to-body">
		        <li role="menuitem"><a ng-click="vm.createByTemplate()" style="cursor: pointer;">基于模板</a></li>
		        <li role="menuitem"><a ng-click="vm.add()" style="cursor: pointer;">直接创建</a></li>
		      </ul>
		    </div>
		    <input class="input pull-right" ng-model="vm.query" ng-change="vm.changePager()" placeholder="输入名称搜索">
		  </div>
		  <table class="pt-table">
		    <thead>
		      <tr>
		        <th>工作流</th>
		        <th custom-sort="group" sort-key="vm.sortKey" reverse="vm.reverse">
		          <span>最新更新</span>
		          <i class="fa fa-sort"></i>
		        </th>
		        <th>状态</th>
		        <th style="width: 140px; ">操作</th>
		      </tr>
		    </thead>
		    <tbody ng-if="vm.loading">
		      <tr>
		        <td class="text-center" colspan="4"><i class="fa fa-spinner fa-pulse"></i></td>
		      </tr>
		    </tbody>
		    <tbody ng-if="!vm.loading && vm.pipelineData.length === 0">
		      <tr>
		        <td class="text-center" colspan="4">暂无数据</td>
		      </tr>
		    </tbody>
		    <tbody ng-if="!vm.loading &&vm.pipelineData.length > 0">
		      <tr ng-repeat="pipeline in vm.pipelineData | filter: {p_name: vm.query} | orderBy:vm.sortKey:vm.reverse | page:vm.page:vm.pageSize">
		      	<td><a ng-click="vm.edit(pipeline.p_id)">{{ pipeline.p_name }}</a></td>
		        <td>{{ pipeline.create_time }}</td>
		        <td ng-if="pipeline.status == '0'">
		        	未启用
		        </td>
		        <td ng-if="pipeline.status == '1'">
		        	已启用
		        </td>
	        	<td ng-if="pipeline.status == '2'">
		        	进行中
		        </td>
		        <td>
		          <img ng-if="pipeline.status=='1'" width="16" height="16" src="../../images/start.png" ng-click="vm.bulid(pipeline.status,pipeline.p_id)" alt="构建" title="构建" />
  		          <img ng-if="pipeline.status=='2'" width="16" height="16" src="../../images/stop.png" ng-click="vm.stop(pipeline.p_id)" alt="停止构建" title="停止构建" />
		          <img ng-if="pipeline.status=='1'" width="16" height="16" src="../../images/delete.png"  confirm data-msg="{{vm.msg}}" data-id="{{pipeline.p_id}}" alt="删除"  title="删除" />
		        </td>
		      </tr>
		    </tbody>
		  </table>
		  <custom-pager page="vm.page" page-size="vm.pageSize" item-length="vm.itemLength" total-count="vm.totalCount" ng-if="vm.totalCount"></custom-pager>
		</div>
	</div>
</div>
